\(\int \frac {\cos (a+\frac {b}{x^2})}{x} \, dx\) [41]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [C] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 12, antiderivative size = 25 \[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=-\frac {1}{2} \cos (a) \operatorname {CosIntegral}\left (\frac {b}{x^2}\right )+\frac {1}{2} \sin (a) \text {Si}\left (\frac {b}{x^2}\right ) \]

[Out]

-1/2*Ci(b/x^2)*cos(a)+1/2*Si(b/x^2)*sin(a)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3459, 3457, 3456} \[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=\frac {1}{2} \sin (a) \text {Si}\left (\frac {b}{x^2}\right )-\frac {1}{2} \cos (a) \operatorname {CosIntegral}\left (\frac {b}{x^2}\right ) \]

[In]

Int[Cos[a + b/x^2]/x,x]

[Out]

-1/2*(Cos[a]*CosIntegral[b/x^2]) + (Sin[a]*SinIntegral[b/x^2])/2

Rule 3456

Int[Sin[(d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Simp[SinIntegral[d*x^n]/n, x] /; FreeQ[{d, n}, x]

Rule 3457

Int[Cos[(d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Simp[CosIntegral[d*x^n]/n, x] /; FreeQ[{d, n}, x]

Rule 3459

Int[Cos[(c_) + (d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Dist[Cos[c], Int[Cos[d*x^n]/x, x], x] - Dist[Sin[c], Int[Si
n[d*x^n]/x, x], x] /; FreeQ[{c, d, n}, x]

Rubi steps \begin{align*} \text {integral}& = \cos (a) \int \frac {\cos \left (\frac {b}{x^2}\right )}{x} \, dx-\sin (a) \int \frac {\sin \left (\frac {b}{x^2}\right )}{x} \, dx \\ & = -\frac {1}{2} \cos (a) \operatorname {CosIntegral}\left (\frac {b}{x^2}\right )+\frac {1}{2} \sin (a) \text {Si}\left (\frac {b}{x^2}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.96 \[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=\frac {1}{2} \left (-\cos (a) \operatorname {CosIntegral}\left (\frac {b}{x^2}\right )+\sin (a) \text {Si}\left (\frac {b}{x^2}\right )\right ) \]

[In]

Integrate[Cos[a + b/x^2]/x,x]

[Out]

(-(Cos[a]*CosIntegral[b/x^2]) + Sin[a]*SinIntegral[b/x^2])/2

Maple [A] (verified)

Time = 0.50 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88

method result size
derivativedivides \(-\frac {\operatorname {Ci}\left (\frac {b}{x^{2}}\right ) \cos \left (a \right )}{2}+\frac {\operatorname {Si}\left (\frac {b}{x^{2}}\right ) \sin \left (a \right )}{2}\) \(22\)
default \(-\frac {\operatorname {Ci}\left (\frac {b}{x^{2}}\right ) \cos \left (a \right )}{2}+\frac {\operatorname {Si}\left (\frac {b}{x^{2}}\right ) \sin \left (a \right )}{2}\) \(22\)
risch \(-\frac {i {\mathrm e}^{-i a} \operatorname {csgn}\left (\frac {b}{x^{2}}\right ) \pi }{4}+\frac {i {\mathrm e}^{-i a} \operatorname {Si}\left (\frac {b}{x^{2}}\right )}{2}+\frac {{\mathrm e}^{-i a} \operatorname {Ei}_{1}\left (-\frac {i b}{x^{2}}\right )}{4}+\frac {{\mathrm e}^{i a} \operatorname {Ei}_{1}\left (-\frac {i b}{x^{2}}\right )}{4}\) \(63\)
meijerg \(-\frac {\sqrt {\pi }\, \cos \left (a \right ) \left (\frac {2 \gamma -4 \ln \left (x \right )+\ln \left (b^{2}\right )}{\sqrt {\pi }}-\frac {2 \gamma }{\sqrt {\pi }}-\frac {2 \ln \left (2\right )}{\sqrt {\pi }}-\frac {2 \ln \left (\frac {b}{2 x^{2}}\right )}{\sqrt {\pi }}+\frac {2 \,\operatorname {Ci}\left (\frac {b}{x^{2}}\right )}{\sqrt {\pi }}\right )}{4}+\frac {\operatorname {Si}\left (\frac {b}{x^{2}}\right ) \sin \left (a \right )}{2}\) \(72\)

[In]

int(cos(a+b/x^2)/x,x,method=_RETURNVERBOSE)

[Out]

-1/2*Ci(b/x^2)*cos(a)+1/2*Si(b/x^2)*sin(a)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=-\frac {1}{2} \, \cos \left (a\right ) \operatorname {Ci}\left (\frac {b}{x^{2}}\right ) + \frac {1}{2} \, \sin \left (a\right ) \operatorname {Si}\left (\frac {b}{x^{2}}\right ) \]

[In]

integrate(cos(a+b/x^2)/x,x, algorithm="fricas")

[Out]

-1/2*cos(a)*cos_integral(b/x^2) + 1/2*sin(a)*sin_integral(b/x^2)

Sympy [F]

\[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=\int \frac {\cos {\left (a + \frac {b}{x^{2}} \right )}}{x}\, dx \]

[In]

integrate(cos(a+b/x**2)/x,x)

[Out]

Integral(cos(a + b/x**2)/x, x)

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.31 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.72 \[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=-\frac {1}{4} \, {\left ({\rm Ei}\left (\frac {i \, b}{x^{2}}\right ) + {\rm Ei}\left (-\frac {i \, b}{x^{2}}\right )\right )} \cos \left (a\right ) - \frac {1}{4} \, {\left (i \, {\rm Ei}\left (\frac {i \, b}{x^{2}}\right ) - i \, {\rm Ei}\left (-\frac {i \, b}{x^{2}}\right )\right )} \sin \left (a\right ) \]

[In]

integrate(cos(a+b/x^2)/x,x, algorithm="maxima")

[Out]

-1/4*(Ei(I*b/x^2) + Ei(-I*b/x^2))*cos(a) - 1/4*(I*Ei(I*b/x^2) - I*Ei(-I*b/x^2))*sin(a)

Giac [F]

\[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=\int { \frac {\cos \left (a + \frac {b}{x^{2}}\right )}{x} \,d x } \]

[In]

integrate(cos(a+b/x^2)/x,x, algorithm="giac")

[Out]

integrate(cos(a + b/x^2)/x, x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\cos \left (a+\frac {b}{x^2}\right )}{x} \, dx=\frac {\sin \left (a\right )\,\mathrm {sinint}\left (\frac {b}{x^2}\right )}{2}-\frac {\cos \left (a\right )\,\mathrm {cosint}\left (\frac {b}{x^2}\right )}{2} \]

[In]

int(cos(a + b/x^2)/x,x)

[Out]

(sin(a)*sinint(b/x^2))/2 - (cos(a)*cosint(b/x^2))/2